home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / util / boot / Kickstop.lha / Kickstop / AmigavisionsLib / Error.a < prev    next >
Text File  |  1999-01-03  |  3KB  |  139 lines

  1. ********************************************************************************
  2. *
  3. *    Program:    Error
  4. *    Filename:    Error.a
  5. *
  6. *    Contents:    Gibt einen Textstring mittlels DisplayAlert aus.
  7. *            Der Textstring wird automatisch im Wordwarp-Verfahren
  8. *            formatierrt. Ein $0a oder $0d-Byte markiert das Ende
  9. *            einer Zeile. Ein 0-Byte markiert das Ende des
  10. *            Textstrings.
  11. *            Inputs: a0.l Zeiger auf TextString (0= Unknown Soft-
  12. *                ware Error)
  13. *            Output: d0.b 01= linke, 00= rechte Maustaste gedrückt
  14. *
  15. *    Language:    68000 Assembler
  16. *
  17. *    Author:        Johannes R. Geiss
  18. *
  19. *    Copyright:    Amigavisions
  20. *
  21. *    History:    $HISTORY:
  22. *            2.2 (26-Oct-91) changed JRG
  23. *            2.1 (19-Oct-91) changed JRG
  24. *            2.0 (10-Oct-91) changed JRG
  25. *            1.2 (10-Oct-91) changed JRG
  26. *            1.1 (02-Jun-91) changed to linkable code JRG
  27. *            1.0 (27-Jan-90) written JRG
  28. *
  29. *    Version:    $VER: Error.a 2.2 (26-Oct-91)
  30. *
  31. ********************************************************************************
  32.  
  33.  
  34. *------ Includes
  35.     include 'xref.i'
  36.     include 'call.i'
  37.  
  38.  
  39. *------ Imports
  40.     XLIB    AllocMem
  41.     XLIB    FreeMem
  42.     XLIB    DisplayAlert
  43.     XLIB    DisplayBeep
  44.     xref    _IntuitionBase
  45.     xref    _SysBase
  46.  
  47.  
  48. *------ Exports
  49.     xdef    Error
  50.  
  51.  
  52. ********************************************************************************
  53.  
  54.     SECTION Error
  55.  
  56. *------ Main procedure
  57. *
  58. * Input: a0.l Zeiger auf Text (0=Unknown Error)
  59. *
  60. * Output: d0.b 01=linke, 00=rechte Maustaste gedrückt
  61.  
  62. Error    movem.l d2-d3/a4-a6,-(a7)
  63.     movea.l a0,a5            ; Zeiger auf TextString holen
  64.     cmpa.l    #0,a5
  65.     bne.s    ImpText            ; Zeiger =0 ?
  66.     movea.l #FehlerText,a5        ; Eingenen Text holen
  67. ImpText move.l    #$7c8,d0        ; $7c8 Bytes Puffer holen
  68.     clr.l    d1
  69.     CALLEXE AllocMem
  70.     move.l    d0,TextBase
  71.     beq    DeadEnd            ; Kein Pufer bekommen
  72.     moveq.l #8,d2
  73.     moveq.l #2,d1
  74.     movea.l TextBase,a4        ; Zeiger auf Puffer
  75. Loop4    addq.l    #8,d2            ; Koordinaten justieren
  76.     cmpi.b    #$c8,d2
  77.     beq.s    Loop8            ; letzte Zeile erreicht
  78.     move.w    #78,d0            ; max Textbreite
  79. Loop2    addq.b    #8,d1
  80.     clr.b    (a4)+            ; Puffer initialisieren
  81.     move.b    #$08,(a4)+
  82.     move.b    d1,(a4)+
  83. Loop5    move.b    (a5)+,d3        ; Text in Puffer übertragen
  84.     bne.s    Lab1
  85.     subq.l    #1,a5
  86.     bra.s    Loop6
  87. Lab1    cmpi.b    #$0a,d3
  88.     beq.s    Loop6
  89.     cmpi.b    #$0d,d3
  90.     beq.s    Loop6
  91.     move.b    d3,(a4)+
  92.     dbf    d0,Loop5
  93. Loop7    subq.l    #1,a4
  94.     cmpi.b    #$20,-(a5)        ; =SPACE ? (Word-warp)
  95.     bne.s    Loop7            ; nein
  96.     addq.l    #1,a5
  97. Loop6    clr.b    (a4)+
  98.     tst.b    (a5)            ; Ende des Textes ?
  99.     beq.s    Loop3            ; ja
  100.     move.b    #$ff,(a4)+
  101.     bra.s    Loop4            ; nächste Zeile
  102. Loop8    subq.l    #1,a4
  103. Loop3    clr.b    (a4)+            ; Ende-Markierung setzen
  104.     moveq.l #0,d0
  105.     movea.l TextBase,a0
  106.     move.l    d2,d1
  107.     CALLITU DisplayAlert        ; DisplayAlert
  108.     move.b    d0,-(a7)        ; Mousebuttonflag merken
  109.     movea.l TextBase,a1
  110.     move.l    #$7c8,d0
  111.     CALLEXE FreeMem
  112.     move.b    (a7)+,d0        ; Mousebuttonflag holen
  113. Out    movem.l (a7)+,d2-d3/a4-a6
  114.     rts
  115.  
  116. DeadEnd suba.l    a0,a0            ; Keinen Puffer bekommen
  117.     CALLITU DisplayBeep
  118.     bra.s    Out
  119.  
  120.  
  121. ********************************************************************************
  122.  
  123.     section data,DATA
  124.  
  125. *------ Datafield
  126. FehlerText
  127.  DC.B $0a
  128.  DC.B '        Unknown software failure!     Press any mousebutton to continue.'
  129.  DC.B $0a,$0a,0
  130.  
  131.  
  132. ********************************************************************************
  133.  
  134.     section data,BSS
  135.  
  136. *------ BSSfield
  137. TextBase    ds.l    1
  138.     END
  139.